v3.4.2 to v3.5.0
WARNING POTENTIAL BUG
Due to a bug in TGenericRepositoryEF correct with package V3.5.1 you should remove the following line in your IocContainer.cs file
collection.AddScoped(typeof(ITGenericRepository<,>), typeof(TGenericRepositoryEF<,>));
To force the usage of the last version package (ie V3.5.1 or higher) run in the Package Manager Console :
dotnet restore --no-cache
You should use BIA.Net.Core.Domain + BIA.Net.Core.Infrastructure.Data + BIA.Net.Core.Ioc V3.5.1 or higher.
AUTOMATIC MIGRATION
-
Use the BIAToolKit to migrate the project
-
Manage the conflict (2 solutions)
- In BIAToolKit click on "4 - merge Rejected" and search
<<<<<
in all files.
- Resolve the conflict manually.
- Analyze the .rej file (search "diff a/" in VS code) that have been created in your project folder
- Apply manually the change.
- In BIAToolKit click on "4 - merge Rejected" and search
-
Change source path and run the script V3.4.2_to_V3.5.0_Replacement.ps1
-
Apply other manual step (describe bellow) at the end if all is ok, you can remove the .rej files (during the process they can be useful to resolve build problem)
MANUAL STEPS
FRONT
-
replace
.culture$.
by.currentCultureDateFormat$.
in the biaTranslationService. ex:this.biaTranslationService.culture$
by
this.biaTranslationService.currentCultureDateFormat$
-
replace import LazyLoadEvent from 'primeng' by 'primeng/api'. Other prime import have similar problems. ex:
import { LazyLoadEvent } from 'primeng';
by
import { LazyLoadEvent } from 'primeng/api';
BACK
- search "ListComponent !== undefined" and correct OnDisplay function in CRUD :
Remove the useless dispatch(loadAllByPost
OnDisplay() {
// if (this.memberListComponent !== undefined) {
// this.store.dispatch(loadAllByPost({ event: this.memberListComponent.getLazyLoadMetadata() }));
}
TROUBLESHOOTING
FRONT
This migration contains a major upgrade for Angular project. The angular version upgrade from v9 to v12. included PrimeNg from v9 to v12.
- Concerning Angular see update guide for more details.
- Concerning PrimeNg see the PrimeOne Migration for more details.
Breaking changes
- With PrimeNg, the main difference is, v10 uses p-* prefix for classes whereas older versions use ui-*
- Icon naming change:
ui-icon-xxx
is replaced bypi pi-xxx
(where xxx is the icon name) - The icon
filter-list
is replaced by the iconfilter
. - The icon
chevron-down
is replaced by the iconangle-down
. - Float label : All input text components support floating labels by adding (.p-float-label) to wrapper class. before
<span class="md-inputfield">
<input formControlName="name" type="text" pInputText maxlength="64" />
<label><span class="bia-star-mandatory">*</span>{{ 'airport.name' | translate }}</label>
</span>
after
<span class="p-float-label">
<input formControlName="name" type="text" pInputText maxlength="64" />
<label><span class="bia-star-mandatory">*</span>{{ 'airport.name' | translate }}</label>
</span>
- PrimeNg traduction Now the traduction use the same json file. So there is a "primeng" element into the I18N json files.
Change done by the script V3.4.2_to_V3.5.0_Replacement.ps1:
Keep the same order listed bellow.
- Replace in html and scss files all
ui-icon
- bypi pi-
- Replace in html and scss files all
chevron-down
byangle-down
. - Replace in html and scss files all
filter-list
byfilter
. - Replace in html and scss files all
md-inputfield
byp-float-label
. - Replace in html and scss files all
ui-button-secondary
byp-button-outlined
. - Replace in html and scss files all
ui-
prefix byp-
. Only in files *.ts, *.html, *.scss. - Dropdown
- You have to set the width of the dropdown according to your form :
- either by parameter
[style]="{ width: '100%' }"
- either by scss
:host ::ng-deep .p-dropdown {
width: 14rem;
}
- either by parameter
- You have to set the width of the dropdown according to your form :
BACK
Automatic
Change done by the script V3.4.2_to_V3.5.0_Replacement.ps1:
-
Search "Mapper()" in the solution and replace the new Mapper() init by call of InitMapper() (ex for Notification)
var mapper = new NotificationMapper();
byNotificationMapper mapper = this.InitMapper<NotificationDto, NotificationMapper>();
-
replace "FileFiltersDto" by "PagingFilterFormatDto" and resolve using if required
-
replace "VersionedTable, IEntity" by "VersionedTable, IEntity<int>"
- And after "VersionedTable, IEntity<int><int>" to "VersionedTable, IEntity<int>"
-
replace ": BaseDto" by ": BaseDto<int>"
- And after ": BaseDto<int><int>" to ": BaseDto<int>"
-
search all
: FilteredServiceBase<
and add "int" as second template parameter
- You can use replacement by using expression replace
: FilteredServiceBase<(.*)>
by: FilteredServiceBase<$1, int>
- search all
ITGenericRepository<
and addint
as second template parameter
- You can use replacement by using expression replace
ITGenericRepository<(.*)>
byITGenericRepository<$1, int>
- search all
: AppServiceBase<
and addint
as second template parameter
- You can use replacement by using expression replace
: AppServiceBase<(.*)>
by: AppServiceBase<$1, int>
- search all
: CrudAppServiceBase<
and addint
as third template parameter
- You can use replacement by using expression replace
: CrudAppServiceBase<(.\*),(.\*),(.\*),(.\*)>
by: CrudAppServiceBase<$1,$2, int,$3,$4>
- search all
: ICrudAppServiceBase<
and addint
as third template parameter
- You can use replacement by using expression replace
: ICrudAppServiceBase<(.\*),(.\*),(.\*)>
by: ICrudAppServiceBase<$1,$2, int,$3>
- search all
: BaseMapper<
and addint
as third template parameter
- You can use replacement by using expression replace
: BaseMapper<(.\*),(.\*)>
by: BaseMapper<$1,$2, int>
-
Not used
IGenericRepository
any more. Use ITGenericRepository -
Not used
DataRepository
any more. Use TGenericRepositoryEF -
Not used
GenericRepositoryEF
any more. Use TGenericRepositoryEF
BUILD
no change
DEPLOY
no change